using System;
using System.Windows;

// ReSharper disable CheckNamespace
namespace DevPhone.Controls
// ReSharper restore CheckNamespace
{
    /// <summary>
    /// Provides attached properties for navigation
    /// Microsoft.Phone.Controls.ITransitions.
    /// </summary>
    /// <QualityBand>Preview</QualityBand>
    public static class TransitionService
    {
        /// <summary>
        /// The
        /// /// DependencyProperty
        /// for the in Microsoft.Phone.Controls.ITransitions.
        /// </summary>
        public static readonly DependencyProperty NavigationInTransitionProperty =
            DependencyProperty.RegisterAttached("NavigationInTransition", typeof(NavigationInTransition), typeof(TransitionService), null);

        /// <summary>
        /// The
        /// /// DependencyProperty
        /// for the in Microsoft.Phone.Controls.ITransitions.
        /// </summary>
        public static readonly DependencyProperty NavigationOutTransitionProperty =
            DependencyProperty.RegisterAttached("NavigationOutTransition", typeof(NavigationOutTransition), typeof(TransitionService), null);

        /// <summary>
        /// Gets the
        /// Microsoft.Phone.Controls.NavigationTransitions
        /// of
        /// Microsoft.Phone.Controls.TransitionService.NavigationInTransitionProperty
        /// for a
        /// System.Windows.UIElement.
        /// </summary>
        /// <param name="element">The System.Windows.UIElement.</param>
        /// <returns>The </returns>
        public static NavigationInTransition GetNavigationInTransition(DependencyObject element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            return (NavigationInTransition)element.GetValue(NavigationInTransitionProperty);
        }

        /// <summary>
        /// Gets the
        /// Microsoft.Phone.Controls.NavigationTransitions
        /// of
        /// Microsoft.Phone.Controls.TransitionService.NavigationOutTransitionProperty
        /// for a
        /// System.Windows.UIElement.
        /// </summary>
        /// <param name="element">The System.Windows.UIElement.</param>
        /// <returns>The </returns>
        public static NavigationOutTransition GetNavigationOutTransition(DependencyObject element)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            return (NavigationOutTransition)element.GetValue(NavigationOutTransitionProperty);
        }

        /// <summary>
        /// Sets a
        /// Microsoft.Phone.Controls.NavigationTransition
        /// to
        /// Microsoft.Phone.Controls.TransitionService.NavigationInTransitionProperty
        /// for a
        /// System.Windows.UIElement.
        /// </summary>
        /// <param name="element">The System.Windows.UIElement.</param>
        /// <param name="value">The Microsoft.Phone.Controls.NavigationTransition.</param>
        /// <returns>The </returns>
        public static void SetNavigationInTransition(DependencyObject element, NavigationInTransition value)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            element.SetValue(NavigationInTransitionProperty, value);
        }

        /// <summary>
        /// Sets a
        /// Microsoft.Phone.Controls.NavigationTransitions
        /// to
        /// Microsoft.Phone.Controls.TransitionService.NavigationOutTransitionProperty
        /// for a
        /// System.Windows.UIElement.
        /// </summary>
        /// <param name="element">The System.Windows.UIElement.</param>
        /// <param name="value">The Microsoft.Phone.Controls.NavigationTransition.</param>
        /// <returns>The </returns>
        public static void SetNavigationOutTransition(DependencyObject element, NavigationOutTransition value)
        {
            if (element == null)
            {
                throw new ArgumentNullException("element");
            }
            element.SetValue(NavigationOutTransitionProperty, value);
        }
    }
}